﻿using LIT.Logger.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UnitTest.ServerChecker
{
    public class EventSenderMock : IEventSender
    {
        public List<Event> EventList;
        public int AliveCallCount;

        public EventSenderMock()
        {
            this.EventList = new List<Event>();
            this.AliveCallCount = 0;
        }

        public bool ReportEvent(Event e)
        {
            this.EventList.Add(e);
            return true;
        }

        public bool ReportException(ExceptionEvent eventException)
        {
            this.EventList.Add(eventException);
            return true;
        }

        public bool ReportSummary(string summary)
        {
            throw new NotImplementedException();
        }

        public event RequestConfigEventHandler RequestConfigEvent;

        public bool SendIsAlive()
        {
            this.AliveCallCount++;
            return true;
        }

        public bool SendPreviousEvents()
        {
            if (RequestConfigEvent != null)
                RequestConfigEvent(null, null);
            return true;
        }
    }
}
